package com.example.springbootjwtexample.utils;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.tuple.Pair;

public class Demo1 {
    public static final String jwtString = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
    public static void main(String[] args) {
        Pair<JSONObject, JSONObject> result = JWTParseUtil.jwtParser(jwtString);
        JSONObject header = result.getLeft();
        JSONObject payload = result.getRight();
        System.err.println(JSONObject.toJSONString(header,true));
        System.err.println(JSONObject.toJSONString(payload,true));
    }
}
